package core;

public class AccountAction implements Comparable<AccountAction> {

	private float m_price;

	private int m_num;

	private boolean m_is_buy;

	public AccountAction(int num, float price, boolean is_buy) {
		m_num = num;
		m_price = price;
		m_is_buy = is_buy;
	}

	int getNum() {
		return m_num;
	}

	float getPrice() {
		return m_price;
	}

	boolean getIsBuy() {
		return m_is_buy;
	}

	float getUsedMoney() {
		return m_price * m_num;
	}

	public int compareTo(AccountAction o) {
		if (m_price > o.m_price)
			return 1;
		else
			return -1;
	}

	public void RemoveNum(int num) {
		m_num -= num;
		if (m_num < 0) {
			System.out.println("@Error :Action num <0 , = " + m_num);
			m_num = 0;
		}
	}

}
